#include "cv_setting.h"
#include "ui_cv_setting.h"

CV_Setting::CV_Setting(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::CV_Setting)
{
    ui->setupUi(this);
}

CV_Setting::~CV_Setting()
{
    delete ui;
}

void CV_Setting::on_CV_CancelButton_clicked()
{
    this->close();
}

void CV_Setting::on_CVSure_Button_clicked()
{
    if((ui->LowE_LineEdit->text()==NULL)||(ui->HighE_LineEdit->text()==NULL)||\
            (ui->InitE_LineEdit->text()==NULL)||(ui->ScanRate_LineEdit->text()==NULL)||\
            (ui->SampleInter_LineEdit==NULL)||(ui->SweepSeg_LineEdit->text()==NULL)||\
            (ui->QuietTime_LineEdit->text()==NULL))
        QMessageBox::about(this,tr("提示"),tr("参数有误，请检查"));
    else  {
        //int CV_Init,CV_Hight,CV_Low,CV_Final,CV_ScanRate,CV_SweepSeg,CV_Sample,CV_QuietTime;
        CV_Init = ui->InitE_LineEdit->text().toDouble();
        CV_Hight= ui->HighE_LineEdit->text().toDouble();
        CV_Low = ui->LowE_LineEdit->text().toDouble();
        CV_Final= ui->FinalE_LineEdit->text().toDouble();
        CV_ScanRate=ui->ScanRate_LineEdit->text().toDouble();
        CV_SweepSeg=ui->SweepSeg_LineEdit->text().toDouble();
        CV_Sample=ui->SampleInter_LineEdit->text().toDouble();
        CV_QuietTime=ui->QuietTime_LineEdit->text().toDouble();
        emit CV_Sendsignal();
        this->close();
    }
}

